// import activity from './../../activity/activity.js';
Page({
  data: {
    activitydata:{},
    spaceimgs:[],
    currentIndex:1
  },
  onLoad: function (options) {
    console.log(options);
    this.setData({
      activitydata:{
        "name": "CITT跨境电商课程",
        // "date": "2018/01/31 14:00",
        // "hasentered":60,
        // "total":200,
        // "address":'北京市海淀区开放大学电商学院（306）',
        // "hoster": "好学好职"
      },
      spaceimgs: ["http://7xlsg9.com2.z0.glb.qiniucdn.com/2018/0201/original/ca4ec9928ef24fac8cdd7821cf8536f8.jpg"]
    })
    // setTimeout(()=>{
      wx.setNavigationBarTitle({
        title: this.data.activitydata.name
      })
    // },1000)
  },
  setCurrent: function(e){
    this.setData({
      currentIndex:e.detail.current+1
    })
  },
  imgPreview: function(){ //图片预览
    const imgs = this.data.spaceimgs;
    wx.previewImage({
      current: imgs[this.data.currentIndex-1], // 当前显示图片的http链接
      urls: imgs // 需要预览的图片http链接列表
    })
  },
  reserveHandle: function(){
    wx.navigateTo({
      url: '../spacereserve/spacereserve'
    })
  }
  // formateNumber:function(n){
  //   return n>9?n:'0'+n
  // }
})
